/*
编写一个程序,输入全年中每月的销售量(图书数量)
程序通过循环,使用初始化为月份字符串的char*数组(或string对象数组)逐月进行提示,
并将输入的数据储存在一个int数组中.然后程序计算数组中各元素的总数,并报告这一年的销售情况
*/
#include<iostream>
const int mo=12;//月份
int sum = 0;
int main()
{
    using namespace std;
    const char * month[mo]{
        "January",
        "February",
        "March",
        "April",
        "May",
        "June",
        "July",
        "August",
        "September",
        "October",
        "November",
        "December"
    };
    int bookNum[mo];
    for(int i = 0;i<mo;i++)
    {
        cout<< "Enter the book sales for "<<month[i]<<"\n"<<endl;
        cin>>bookNum[i];
    }
    for (const auto& element : bookNum) {
        sum += element;
    }
    for(int i =0;i<12;i++)
    {
        cout<< month[i] <<"  sold  "<<bookNum[i]<<"  peaces of books"<<endl;
    }
    cout<<"sum:"<<sum<<endl;
}
